package edu.ccut.saturn.component.impl.directory;

import org.osgi.framework.Bundle;

import edu.ccut.saturn.component.IBundleInfo;
import edu.ccut.saturn.component.IDirectoryInfo;
import edu.ccut.saturn.component.ILogger;
import edu.ccut.saturn.component.SaturnLoggerManager;

/**
 * 路径资源的抽象类，实现了接口<code>IDirectoryInfo</code>，定义了描述路径资源的基本信息：
 * <li>字段version：记录了路径资源的版本信息
 * <li>字段description：记录了路径资源的描述信息
 * <li>字段type：记录了路径资源的类型
 * <li>字段time：记录了路径资源的创建时间
 * <li>字段directoryPath：记录了路径资源在bundle中的相对路径信息
 * <p>在代表路径资源的文件夹下有一个“.saturn”文件，用来描述这个路径资源的上述信息。 
 * 
 * @author 谷钰
 * @version 1.0 2008.8.26
 * 
 * @see IDirectoryInfo
 * 
 */
public abstract class AbstractDirectoryInfo implements IDirectoryInfo {

	private static final String LOGGER_KEY_LOAD_BUNDLE = SaturnLoggerManager.LOGGER_KEY_LOAD_BUNDLE;

	protected static ILogger logger = SaturnLoggerManager.getInstance()
			.getSaturnLogger(LOGGER_KEY_LOAD_BUNDLE);

	private String version;

	private String description;

	private String type;

	private String time;

	private String directoryPath;

	public AbstractDirectoryInfo(String type) {
		this.type = type;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public String getDirectoryPath() {
		return directoryPath;
	}

	public void setDirectoryPath(String directoryPath) {
		this.directoryPath = directoryPath;
	}

	public abstract void load(Bundle bundle, IBundleInfo bundleInfo);

	public void unload(Bundle bundle, IBundleInfo bundleInfo) {

	}
}